<script setup>
import { provide, ref } from 'vue'
import Father from './components/Father.vue'
const count = ref(0)
// provide有俩参数 第一个是变量名 第二个是数据
provide('count', count)

// 还可以传递方法
const updateCount = (num) => {
  count.value += num
}
provide('updateCount', updateCount)
</script>

<template>
  <div>
    App
    <Father></Father>
  </div>
</template>

<style scoped></style>
